#ifndef UTIL_COMMUNICATION_H
#define UTIL_COMMUNICATION_H


#include "http.h"
#include <vector>
#include "s3eFile.h"
#include "IwArray.h"
#include "IwArray.h"
#include <string>
#include "IwManaged.h"
#include "IwSerialise.h"
#include "s3e.h"
#include "../Persistence/UtilPersistence.h"




#define GENTRACE(a, b, c) printf("[%s, %s] TRAZA: %s\n", a, b, c)

class CUtilCommunication : public CIwManaged
{
public:

	CUtilCommunication();
	IW_MANAGED_DECLARE(CUtilCommunication);	
	void descargar(char* accion, char* parametros);
	static void HCategorias(void* pArgument, const char* pURL, const char* pResult, int32 resultLen);
	void saveElement(const char *data, int32 dataLen, const char* name);
	bool Update();
	bool getCategoriasDisponibles();
	void setCategoriasDisponibles(bool n);


private:

	CIwHTTPQueue httpQueue;
	bool CategoriasDisponibles;
	CUtilPersistence *uPer;
	
};

extern CUtilCommunication *commObject;

#endif